
const resCig = require("../config/response");


module.exports = {
    //发送文件
    sendHtml: function(req, res) {
        let url = req.url.split(".");
        if (url[1] == 'js') {
            url[1] = 'javascript';
        }
        resCig.res(res,`src${req.url}`,"'content-type':`text/${url[1]};charset=utf-8`")
       
    },
    //发送图片
    sendImage (req, res) {
        let url = req.url.split(".");
        resCig.res(res,`src${req.url}`,"'content-type':`image/${url[1]}`")
    }
}